package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 开发团队 ：lxh
 * 开发人员 ：李兴洋
 * 开发时间 ：2020年3月10日15:50:51
 * 类的名称 ：ServeRecord
 * 类的描述 ：客户服务
 */
@Entity
public class ServeRecord {
    private int serveRecId;
    private String serveName;
    private String serveCon;
    private String cusFeed;
    private Date beginTime;
    private String expTime;
    private Integer serveState;
    private Integer check;

    private ServeMode serveMode;
    private ServeType serveType;
    private Emp callEmp;
    private Emp dealEmp;
    private Customer customer;


    @ManyToOne
    @JoinColumn(name = "serve_mode_id")
    public ServeMode getServeMode() {
        return serveMode;
    }

    public void setServeMode(ServeMode serveMode) {
        this.serveMode = serveMode;
    }

    @ManyToOne
    @JoinColumn(name = "serve_type_id")
    public ServeType getServeType() {
        return serveType;
    }

    public void setServeType(ServeType serveType) {
        this.serveType = serveType;
    }

    @ManyToOne
    @JoinColumn(name = "call_emp_id")
    public Emp getCallEmp() {
        return callEmp;
    }

    public void setCallEmp(Emp callEmp) {
        this.callEmp = callEmp;
    }

    @ManyToOne
    @JoinColumn(name = "deal_emp_id")
    public Emp getDealEmp() {
        return dealEmp;
    }

    public void setDealEmp(Emp dealEmp) {
        this.dealEmp = dealEmp;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }


    @Id
    @Column(name = "serve_rec_id",nullable = false)
    public int getServeRecId() {
        return serveRecId;
    }

    public void setServeRecId(int serveRecId) {
        this.serveRecId = serveRecId;
    }

    @Basic
    @Column(name = "serve_name",nullable = true,length = 40)
    public String getServeName() {
        return serveName;
    }

    public void setServeName(String serveName) {
        this.serveName = serveName;
    }

    @Basic
    @Column(name = "serve_con",nullable = true,length = 200)
    public String getServeCon() {
        return serveCon;
    }

    public void setServeCon(String serveCon) {
        this.serveCon = serveCon;
    }

    @Basic
    @Column(name = "cus_feed",nullable = true,length = 200)
    public String getCusFeed() {
        return cusFeed;
    }

    public void setCusFeed(String cusFeed) {
        this.cusFeed = cusFeed;
    }

    @Basic
    @Column(name = "begin_time",nullable = true)
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Basic
    @Column(name = "exp_time",nullable = true,length = 40)
    public String getExpTime() {
        return expTime;
    }

    public void setExpTime(String expTime) {
        this.expTime = expTime;
    }

    @Basic
    @Column(name = "state",nullable = true,length = 11)
    public Integer getServeState() {
        return serveState;
    }

    public void setServeState(Integer serveState) {
        this.serveState = serveState;
    }

    @Basic
    @Column(name = "check_state",nullable = true,length = 200)
    public Integer getCheck() {
        return check;
    }

    public void setCheck(Integer check) {
        this.check = check;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ServeRecord that = (ServeRecord) o;
        return serveRecId == that.serveRecId &&
                Objects.equals(serveName, that.serveName) &&
                Objects.equals(serveCon, that.serveCon) &&
                Objects.equals(cusFeed, that.cusFeed) &&
                Objects.equals(beginTime, that.beginTime) &&
                Objects.equals(expTime, that.expTime) &&
                Objects.equals(serveState, that.serveState) &&
                Objects.equals(serveMode, that.serveMode) &&
                Objects.equals(serveType, that.serveType) &&
                Objects.equals(callEmp, that.callEmp) &&
                Objects.equals(dealEmp, that.dealEmp) &&
                Objects.equals(customer, that.customer) &&
                Objects.equals(check, that.check);
    }

    @Override
    public int hashCode() {
        return Objects.hash(serveRecId, serveName, serveCon, cusFeed, beginTime, expTime, serveState, serveMode, serveType, callEmp, dealEmp, customer, check);
    }
}
